﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NF_DAL;
using NF_Mode;
using NF_Base;

namespace NF_Bll
{
    public static class UserLogin_Bll<T> where T : class
    {
        /// <summary>
        /// 用户登陆
        /// </summary>
        /// <param name="us">用户对象</param>
        /// <param name="bar">框架应答消息</param>
        /// <returns>返回用户</returns>
        public static void LoginByPassword(SysUser us,ref BaseAnswer bar)
        {

            List<dynamic> lstsus = NF_DAL.UserLogin_DAL<T>.LoingByPassword(us, ref bar);
            if (lstsus.Count > 0)
            {
                var sus = lstsus[0];
                //宏赋值
                BaseClass.us.us_RealName = sus.us_RealName;
                BaseClass.us.us_Id = sus.us_Id;
                BaseClass.us.us_Password = sus.us_Password;
                BaseClass.us.us_UserName = sus.us_UserName;
                BaseClass.ro.ro_Id = sus.ro_Id;
                BaseClass.ro.ro_Name = sus.ro_Name;
            }



        }
    }
}
